import { instance as request } from "@/utils/request";

const login = (data?: any) => {
  return request<any, any>({
    method: "POST",
    url: "/login",
    data: data,
  });
};
const register = (data?: any) => {
  return request<any, any>({
    method: "POST",
    url: "/register",
    data: data,
  });
};

const modifyUserInfo = (data?: any) => {
  return request<any, any>({
    method: "POST",
    url: "/modifyUserInfo",
    data: data,
  });
};

const getUserDetail = (params?: any) => {
  return request<any, any>({
    method: "get",
    url: "/getUserDetail",
    params: params,
  });
};

const upload = (data?: any) => {
  return request<any, any>({
    method: "post",
    url: "/upload",
    data: data,
  });
};

const addHistory = (data?: any) => {
  return request<any, any>({
    method: "post",
    url: "/addHistory",
    data: data,
  });
};
const getHistoryList = (params?: any) => {
  return request<any, any>({
    method: "get",
    url: "/getHistoryList",
    params: params,
  });
};

export {
  login,
  register,
  modifyUserInfo,
  getUserDetail,
  upload,
  addHistory,
  getHistoryList,
};
